import React, { useEffect, useRef, useState } from 'react'
import ReactECharts from 'echarts-for-react';
import * as echarts from 'echarts';
import { getEchartsData } from '../../api';

const Index = () => {

	const [option, setOption] = useState({});
	
	useEffect(() => {
		getEchartsData().then(resp => {
			setOption(resp.data)
		})
	}, [])

	return (
		<div>

			<ReactECharts option={option} style={{ width: 500, height: 500 }} />
		</div>
	)
}

export default Index